function isOptional(val) {
    // undefined , null , ""  , "    ", 皆通过
    if (val === void 0) {
        return true;
    }
    if (val === null) {
        return true;
    }
    if (typeof val === 'string') {
        return val === '' || val.trim() === '';
    }
    return false;
}

function isOptionalObj(obj) { // 删除对象里的 
    for (let key in obj) {
        if (isOptional(obj[key])) {
            delete obj[key]
        }
    }
    return obj
}
module.exports = {
    isOptional,
    isOptionalObj
};